#ifndef _DSWMSGSESSION_BASE_H
#define _DSWMSGSESSION_BASE_H
#include <libbase/dswtcpclient_base.h>

class CDswmsgsession_base : public CDswtcpclient_base
{
public:
	CDswmsgsession_base(LPST_ENV_T pEnv, struct event_base *base, int nfd, int nWantReadLen);
	CDswmsgsession_base(LPST_ENV_T pEnv, char* pHost, int nPort);
	virtual ~CDswmsgsession_base();
protected:
	virtual bool ProcessMessage(char* pMsg, int nLen, struct evbuffer *outbuf);
	virtual void SendMsg(char * pMsg){};
	virtual bool GetPUCID(char* pMsg){return true;};
	virtual void ProcessBody(char* pMsg){};
	virtual void AddP2PMsgSession(CMarkup &xml){};
private:
	int ProcessSetParamMsg(char* pMsg, bool &bNeedSave);
public:
	static bool cbDealGetParamModifyV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetParamModifyV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetParamV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetParamV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetRebootV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetRebootV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetSdDirListV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetSdDirListV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetZoneParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetZoneParamV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetZoneParamAppendV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetZoneParamAppendV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetZoneParamDelV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetZoneParamDelV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetZoneParamModifyV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetZoneParamModifyV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetRecVideoV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetRecVideoV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetRecVideoOpV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetRecVideoOpV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetMuteV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetMuteV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetRMCtrlV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetRMCtrlV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetValidRfdevV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetValidRfdevV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetDeviceModeV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetDeviceModeV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetTotalZoneStateV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetTotalZoneStateV2Req(pCId, pMsgReq, pMsgIDResp);};

	static bool cbDealTCPP2PResp(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealTCPP2PResp(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealRegisterToP2PServer(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealRegisterToP2PServer(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealHeartResp(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealHeartResp(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealGetPUAV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealGetPUAV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealStartStreamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealStartStreamV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealStopStreamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealStopStreamV2Req(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealStartTransStreamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealStartTransStreamReq(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealStopTransStreamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealStopTransStreamReq(pCId, pMsgReq, pMsgIDResp);};
	static bool cbDealSetParamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp, void* pCaller){return ((CDswmsgsession_base*)pCaller)->DealSetParamReq(pCId, pMsgReq, pMsgIDResp);};
protected:
//LAN
	bool DealGetParamModifyV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetRebootV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetSdDirListV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetZoneParamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetZoneParamAppendV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetZoneParamDelV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetZoneParamModifyV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetRecVideoV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetRecVideoOpV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetMuteV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetRMCtrlV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetValidRfdevV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealSetDeviceModeV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
	bool DealGetTotalZoneStateV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp);
//WAN
	virtual bool DealTCPP2PResp(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealRegisterToP2PServer(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealHeartResp(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealGetPUAV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealStartStreamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealStopStreamV2Req(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealStartTransStreamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealStopTransStreamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
	virtual bool DealSetParamReq(char* pCId, void* pMsgReq, const char* pMsgIDResp){return false;};
private:
	EN_CLIENT_TYPE m_nClientType;
	char m_sClientUser[32];
};
#endif

